package com.hanxiaozhang.oauth2.utils;

import com.hanxiaozhang.oauth2.secuity.CurrentUser;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * 功能描述: <br>
 * 〈〉
 *
 * @Author:hanxinghua
 * @Date: 2020/7/27
 */
public class SecuityUtils {
    public static CurrentUser getCurrentUser() {
        return (CurrentUser) SecurityContextHolder.getContext()
                .getAuthentication()
                .getPrincipal();
    }
}
